{extend name="index_layout"/}
{block name="main"}
<style type="text/css">
.admin-info {padding: 50px 20px 35px 20px; }
.admin-info .profile-avatar-container { width: 112px; height: 112px; margin: 0 auto; position: relative;}
.profile-avatar-container .profile-avatar-text {
    display: none;
}
.profile-user-img {
    margin: 0 auto;
    width: 100px;
    height: 100px;
    padding: 3px;
    border: 3px solid #d2d6de;
    border-radius: 50%;
}
.profile-avatar-container button {
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 0;
    width: 112px;
    height: 112px;
    opacity: 0;
}
.profile-avatar-container:hover .profile-avatar-text {
    display: block;
    position: absolute;
    height: 112px;
    width: 112px;
    background: #444;
    opacity: .6;
    color: #fff;
    top: 0;
    left: 0;
    line-height: 112px;
    text-align: center;
    border-radius: 50%;
}
.layui-user {display: block; width: 100%; height: 30px; line-height: 30px; text-align: center; padding-top: 15px; color: #333; font-size: 16px; }
.login-time {display: block; width: 100%; height: 30px; line-height: 30px; text-align: center; font-size: 14px; color: #666777; }
</style>
<div class="layui-row layui-col-space20">
    <div class="layui-col-sm4 layui-col-md3 layui-col-lg3">
        <div class="layui-card">
            <div class="layui-card-header">个人资料</div>
            <div class="layui-card-body">
                <form id="profile" class="layui-form" method="post" action="{:url('update')}">
                    <div class="admin-info">
                        <div class="profile-avatar-container">
                            <img class="profile-user-img" src="{$admin.avatar|cdnurl}">
                            <div class="profile-avatar-text">点击编辑</div>
                            <button type="button" id="faupload-avatar" class="faupload" data-input-id="c-avatar">上传</button>
                        </div>
                        <h3 class="layui-user">{$admin.email}</h3>
                        <p class="login-time">上次登录：<?php if($admin['last_login_time'] > 0) { echo $admin['last_login_time'];} else { echo '--';}?></p>
                    </div>
                    {:token_field()}
                    <input type="hidden" id="c-avatar" name="row[avatar]" value="{$admin.avatar}"/>
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-inline">
                            <input type="text" autocomplete="off" placeholder="用户名" class="layui-input layui-disabled" value="{$admin.username}" disabled>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">密码</label>
                        <div class="layui-input-inline">
                            <input type="password" name="row[password]" autocomplete="off" placeholder="不修改留空即可" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">邮箱</label>
                        <div class="layui-input-inline">
                            <input type="text" name="row[email]" lay-verify="required|email" autocomplete="off" placeholder="邮箱" class="layui-input" value="{$admin.email}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">手机</label>
                        <div class="layui-input-inline">
                            <input type="text" name="row[mobile]" autocomplete="off" placeholder="手机" class="layui-input" value="{$admin.mobile}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">昵称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="row[nickname]" autocomplete="off" placeholder="昵称" class="layui-input" value="{$admin.nickname}">
                        </div>
                    </div>
                    <div class="layui-form-item layer-footer">
                        <div class="layui-input-block">
                            <button class="layui-btn disabled" lay-submit>立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="layui-col-sm8 layui-col-md9 layui-col-lg9">
        <div class="layui-card">
            <div class="layui-card-header">操作日志</div>
            <div class="layui-card-body">
                <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
            </div>
        </div>
    </div>
</div>
{/block}